#!/bin/bash

######## UG ########
## run_v2lvs.sh <netlist>
####################

netlist=$1
top_name=$(/apps/mentor/aoi_cal_2018.4_17.10/bin/python3 /projects.SE024/cascade/workspace/xjsun/PV/v2lvs/get_top_name.py ${netlist})

echo ${top_name}
outfile="${top_name}.spi"
v2lvs -v ${netlist} -o ${outfile}

echo  ".include /projects/cascade/workspace/xjsun/DDRPHY/innovus.241119/datain/IP/SPICE/DLY_LINE_512.netlist" >> ${outfile}
echo  ".include /projects/cascade/workspace/xjsun/DDRPHY/innovus.241119/datain/IP/SPICE/DLY_LINE_1024_MAT.netlist" >> ${outfile}

#### pdk stdcell ####
echo  ".include /pdks/tsmc/CLN06FF/std/TSMCHOME/digital/Back_End/spice/tcbn06_bwph240l11p57cpd_base_lvt_100a/tcbn06_bwph240l11p57cpd_base_lvt_100a.spi" >> ${outfile} 
echo  ".include /pdks/tsmc/CLN06FF/std/TSMCHOME/digital/Back_End/spice/tcbn06_bwph240l11p57cpd_base_svt_100a/tcbn06_bwph240l11p57cpd_base_svt_100a.spi" >> ${outfile}
echo  ".include /pdks/tsmc/CLN06FF/std/TSMCHOME/digital/Back_End/spice/tcbn06_bwph240l11p57cpd_base_ulvt_100a/tcbn06_bwph240l11p57cpd_base_ulvt_100a.spi" >> ${outfile}
echo  ".include /pdks/tsmc/CLN06FF/std/TSMCHOME/digital/Back_End/spice/tcbn06_bwph240l11p57cpd_lvl_lvt_100a/tcbn06_bwph240l11p57cpd_lvl_lvt_100a.spi" >> ${outfile}
echo  ".include /pdks/tsmc/CLN06FF/std/TSMCHOME/digital/Back_End/spice/tcbn06_bwph240l11p57cpd_lvl_svt_100a/tcbn06_bwph240l11p57cpd_lvl_svt_100a.spi" >> ${outfile}
echo  ".include /pdks/tsmc/CLN06FF/std/TSMCHOME/digital/Back_End/spice/tcbn06_bwph240l11p57cpd_lvl_ulvt_100a/tcbn06_bwph240l11p57cpd_lvl_ulvt_100a.spi" >> ${outfile}
echo  ".include /pdks/tsmc/CLN06FF/std/TSMCHOME/digital/Back_End/spice/tcbn06_bwph240l11p57cpd_mb_lvt_100a/tcbn06_bwph240l11p57cpd_mb_lvt_100a.spi" >> ${outfile}
echo  ".include /pdks/tsmc/CLN06FF/std/TSMCHOME/digital/Back_End/spice/tcbn06_bwph240l11p57cpd_mb_svt_100a/tcbn06_bwph240l11p57cpd_mb_svt_100a.spi" >> ${outfile}
echo  ".include /pdks/tsmc/CLN06FF/std/TSMCHOME/digital/Back_End/spice/tcbn06_bwph240l11p57cpd_mb_ulvt_100a/tcbn06_bwph240l11p57cpd_mb_ulvt_100a.spi" >> ${outfile}
echo  ".include /pdks/tsmc/CLN06FF/std/TSMCHOME/digital/Back_End/spice/tcbn06_bwph240l11p57cpd_pm_lvt_100a/tcbn06_bwph240l11p57cpd_pm_lvt_100a.spi" >> ${outfile}
echo  ".include /pdks/tsmc/CLN06FF/std/TSMCHOME/digital/Back_End/spice/tcbn06_bwph240l11p57cpd_pm_svt_100a/tcbn06_bwph240l11p57cpd_pm_svt_100a.spi" >> ${outfile}
echo  ".include /pdks/tsmc/CLN06FF/std/TSMCHOME/digital/Back_End/spice/tcbn06_bwph240l11p57cpd_pm_ulvt_100a/tcbn06_bwph240l11p57cpd_pm_ulvt_100a.spi" >> ${outfile}
echo  ".include /pdks/tsmc/CLN06FF/std/TSMCHOME/digital/Back_End/spice/tcbn06_bwph240l8p57cpd_base_lvt_100a/tcbn06_bwph240l8p57cpd_base_lvt_100a.spi" >> ${outfile}
echo  ".include /pdks/tsmc/CLN06FF/std/TSMCHOME/digital/Back_End/spice/tcbn06_bwph240l8p57cpd_base_svt_100a/tcbn06_bwph240l8p57cpd_base_svt_100a.spi" >> ${outfile}
echo  ".include /pdks/tsmc/CLN06FF/std/TSMCHOME/digital/Back_End/spice/tcbn06_bwph240l8p57cpd_base_ulvt_100a/tcbn06_bwph240l8p57cpd_base_ulvt_100a.spi" >> ${outfile}
echo  ".include /pdks/tsmc/CLN06FF/std/TSMCHOME/digital/Back_End/spice/tcbn06_bwph240l8p57cpd_lvl_lvt_100a/tcbn06_bwph240l8p57cpd_lvl_lvt_100a.spi" >> ${outfile}
echo  ".include /pdks/tsmc/CLN06FF/std/TSMCHOME/digital/Back_End/spice/tcbn06_bwph240l8p57cpd_lvl_svt_100a/tcbn06_bwph240l8p57cpd_lvl_svt_100a.spi" >> ${outfile}
echo  ".include /pdks/tsmc/CLN06FF/std/TSMCHOME/digital/Back_End/spice/tcbn06_bwph240l8p57cpd_lvl_ulvt_100a/tcbn06_bwph240l8p57cpd_lvl_ulvt_100a.spi" >> ${outfile}
echo  ".include /pdks/tsmc/CLN06FF/std/TSMCHOME/digital/Back_End/spice/tcbn06_bwph240l8p57cpd_mb_lvt_100a/tcbn06_bwph240l8p57cpd_mb_lvt_100a.spi" >> ${outfile}
echo  ".include /pdks/tsmc/CLN06FF/std/TSMCHOME/digital/Back_End/spice/tcbn06_bwph240l8p57cpd_mb_svt_100a/tcbn06_bwph240l8p57cpd_mb_svt_100a.spi" >> ${outfile}
echo  ".include /pdks/tsmc/CLN06FF/std/TSMCHOME/digital/Back_End/spice/tcbn06_bwph240l8p57cpd_mb_ulvt_100a/tcbn06_bwph240l8p57cpd_mb_ulvt_100a.spi" >> ${outfile}
echo  ".include /pdks/tsmc/CLN06FF/std/TSMCHOME/digital/Back_End/spice/tcbn06_bwph240l8p57cpd_pm_lvt_100a/tcbn06_bwph240l8p57cpd_pm_lvt_100a.spi" >> ${outfile}
echo  ".include /pdks/tsmc/CLN06FF/std/TSMCHOME/digital/Back_End/spice/tcbn06_bwph240l8p57cpd_pm_svt_100a/tcbn06_bwph240l8p57cpd_pm_svt_100a.spi" >> ${outfile}
echo  ".include /pdks/tsmc/CLN06FF/std/TSMCHOME/digital/Back_End/spice/tcbn06_bwph240l8p57cpd_pm_ulvt_100a/tcbn06_bwph240l8p57cpd_pm_ulvt_100a.spi" >> ${outfile}